package com.test.resumeanalysis.ui.talent.talent_info

import android.view.LayoutInflater
import android.view.ViewGroup
import com.test.resumeanalysis.common.CommonRvAdapter
import com.test.resumeanalysis.common.CommonRvHolder
import com.test.resumeanalysis.data.model.resume.ParsingResult
import com.test.resumeanalysis.data.model.resume.ResumeParse
import com.test.resumeanalysis.data.model.resume.WorkExperience
import com.test.resumeanalysis.databinding.RvPostInfoBinding
import com.test.resumeanalysis.databinding.RvWorkEpBinding

class WorkEpAdapter: CommonRvAdapter<WorkExperience, RvWorkEpBinding>() {
    override fun onCreateViewHolder(
        parent: ViewGroup,
        viewType: Int
    ): CommonRvHolder<RvWorkEpBinding> {
        val inflate = RvWorkEpBinding.inflate(LayoutInflater.from(parent.context), parent, false)
        return CommonRvHolder(inflate)
    }

    override fun onBindViewHolder(
        holder: CommonRvHolder<RvWorkEpBinding>,
        position: Int,
        binding: RvWorkEpBinding,
        bean: WorkExperience
    ) {

        holder.binding.tvWorkName.text =  bean.job_title
        val time  = bean.start_time_year+"-"+ bean.end_time_year
        holder.binding.workTime.text  = time
        holder.binding.workCompany.text =  bean.company_name
        holder.binding.workFunction.text =  bean.job_function
    }
}